package com.qf.zsq.task;



import com.qf.zsq.service.IOrderService;

import java.util.Timer;
import java.util.TimerTask;

public class OrderTask extends TimerTask {
    private IOrderService orderService;
    private String oid;
    private Timer timer;

    public OrderTask(){}

    public OrderTask(IOrderService orderService, String oid, Timer timer) {
        this.orderService = orderService;
        this.oid = oid;
        this.timer = timer;
    }

    @Override
    public void run() {
        orderService.upOstatus(oid);

        //取消任务 并且从 作用于里面移除timer
        timer.cancel();
    }
}
